package com.itheima.consumer.web;

import com.itheima.pojo.User;
import com.itheima.service.UserService;

import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class UserController {
    @Reference
    private UserService userService;
    @RequestMapping("/findAll")
    public List<User> findAll(){

        return userService.list();
    }
    @RequestMapping("/delById/{id}")
    public boolean delById(@PathVariable("id") Long id){
        return userService.removeById(id);
    }

}
